<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .list-enter-active,
      .list-leave-active {
        transition: all 0.5s ease;
      }
      .list-enter-from,
      .list-leave-to {
        opacity: 0;
        transform: translateX(30px);
      }
    </style>
  </head>
  <body>
    <div id="app">
      <h2>TransitionGroup</h2>
      <button @click="fn">btn</button>
      <transition-group name="list" tag="ul">
        <li v-for="item in items" :key="item">{{ item }}</li>
      </transition-group>
    </div>

    <script src="./lib/vue3.js"></script>
    <script>
      const { createApp } = Vue;

      const app = createApp({
        data() {
          return {
            items: [1, 2, 3, 4, 5],
          };
        },
        methods: {
          fn() {
            this.items.push(6);
          },
        },
      });

      app.mount("#app");
    </script>
  </body>
</html>
